package Demo;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class Test3 {
    public static void main(String[] args) {
        //创建线程池对象
        ThreadPoolExecutor p = new ThreadPoolExecutor(3,6,
                10,TimeUnit.SECONDS,new ArrayBlockingQueue<>(10),
                Executors.defaultThreadFactory(),new ThreadPoolExecutor.AbortPolicy());
        p.submit(new MyRunnable());
        p.submit(new MyRunnable());

        p.shutdown();
    }
}
